<template>
	<view style="overflow: hidden;">
		<view style="height: 20rpx;background-color: #f8f8f8;"></view>
		<view class="pl-30 pr-30">
			<view class=" pt-40 pb-40">
				<view class="size-28">药品名称及各自金额：</view>
				<textarea v-model="name" name="" id="" cols="30" rows="10" placeholder="请输入"></textarea>
			</view>
			<!-- <view class=" pt-40 pb-40" style="border-bottom: 2rpx solid #F1F1F1;">
				<view class="size-28">病情描述：</view>
				<textarea name="" id="" cols="30" disabled rows="10" placeholder="请输入"></textarea>
			</view> -->
			<view class=" pt-40 pb-40">
				<view class="size-28">药品备注：</view>
				<textarea v-model="bz" name="" id="" cols="30" rows="10" placeholder="请输入"></textarea>
			</view>
			<view class=" pt-40 pb-40">
				<view class="size-28">药品总价格：</view>
				<textarea v-model="price" style="height: 80rpx;" name="" id="" cols="30" rows="10"
					placeholder="请输入"></textarea>
			</view>
			<view class="btn" @click="kaiyao">
				保存
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name: '',
				bz: '',
				price: '',
				id: ''
			};
		},
		onLoad(op) {
			this.id = op.id
		},
		methods: {
			kaiyao() {
				if (this.name == '') {
					this.$utils.showToast('请输入药品名称')
				} else if (this.price == '') {
					this.$utils.showToast('请输入价格')
				} else {
					this.$api.prescribe({
						order_id: this.id,
						medicine_name: this.name,
						medicine_remark: this.bz,
						medicine_price: this.price
					}).then(res => {
						this.$utils.showToast(res.msg)
					})
				}

			},
		}
	}
</script>

<style lang="scss">
	.btn {
		margin: 168rpx auto 80rpx;
	}

	input {
		text-align: right;
		font-size: 28rpx;
	}

	.img {
		width: 164rpx;
		height: 164rpx;
		border-radius: 20rpx 20rpx 20rpx 20rpx;

		image {
			width: 164rpx;
			height: 164rpx;
		}
	}

	textarea {
		width: 100%;
		height: 164rpx;
		background: #F8F8F8;
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		padding: 30rpx;
		box-sizing: border-box;
		font-size: 24rpx;
		margin-top: 30rpx;
	}
</style>
